using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Input;
using HappySprite;

namespace HappyInvaders
{
    class InvaderGame : Game
    {
        Presenter presenter;

        public InvaderGame()
        {
            Window.Title = "Happy Invaders";

            Global.Initialize(this);
            Global.Renderer.Graphics.PreferredBackBufferWidth = Constants.ScreenWidth;
            Global.Renderer.Graphics.PreferredBackBufferHeight = Constants.ScreenHeight;

            Global.Audio.LoadAudioEngine(Constants.AudioSettings);
            Global.Audio.LoadWaveBank(Constants.WaveBank);
            Global.Audio.LoadSoundBank(Constants.SoundBank);
        }

        protected override void Initialize()
        {
            presenter = new Presenter(new Model(), new View());
            base.Initialize();
        }

        protected override void Draw(GameTime gameTime)
        {
            Global.Renderer.Clear(Color.CornflowerBlue);
            presenter.Draw();
            base.Draw(gameTime);
        }

        protected override void Update(GameTime gameTime)
        {
            presenter.Update(gameTime);
            base.Update(gameTime);
        }
    }
}
